import bus from "@/bus";
import { renderButton } from '@/util';
let prevMonth = () => {
  let date = new Date()
  let curMonth = new Date().getMonth() + 1
  let year = null
  let prMonth = null
  if (curMonth == 1) {
    prMonth = 12
    year = date.getFullYear() - 1
  } else {
    prMonth = curMonth - 1
    year = date.getFullYear()
  }
  return year + '-' + prMonth
}
let data = {
  status: 'pass',
  totalItem: 1,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    time: prevMonth(),
    year: '',
    month: '',
    addressArr: [],
    areaId: null,
    cityId: null,
    provinceId: null,
    distributorId: null,
    distributorName: '',
    storeId: null,
    storeName: '',
    status: '0',
    departmentObj: {},
    departmentId: null,
    blockId: null
  },
  branch: [],
  columns: [{
    title: '门店名称',
    key: 'storeName',
    align: 'left',
    minWidth: 200,
    fixed: 'left',
    tooltip: true
  }, {
    title: '经销商',
    key: 'distributorName',
    align: 'left',
    minWidth: 210,
    tooltip: true
  }, {
    title: '门店类型',
    key: 'storeTypeName',
    align: 'left',
    minWidth: 100
  }, {
    title: '门头编号',
    key: 'storeNo',
    align: 'left',
    minWidth: 200
  }, {
    title: '联系人',
    key: 'storeContactName',
    align: 'left',
    minWidth: 150
  }, {
    title: '手机号',
    key: 'storePhone',
    align: 'left',
    minWidth: 150
  }, {
    title: '科室',
    key: 'departmentName',
    align: 'left',
    minWidth: 150
  }, {
    title: '部门',
    key: 'blockName',
    align: 'left',
    width: 150
  }, {
    title: '申请日期',
    key: 'createDate',
    align: 'left',
    minWidth: 200
  }, {
    title: '所在区域',
    key: 'address',
    minWidth: 200
  }, {
    title: '评分',
    key: 'score',
    align: 'left',
    minWidth: 100
  }, {
    title: '评分人',
    key: 'scoreOperateName',
    align: 'left',
    minWidth: 150
  }, {
    title: '状态',
    key: 'statusMeaning',
    align: 'left',
    minWidth: 100
  }, {
    title: '审核人',
    key: 'auditOperateName',
    align: 'left',
    minWidth: 150
  }, {
    title: '扫码入库数',
    key: 'increaseQuantity',
    align: 'right',
    minWidth: 120
  }, {
    title: '退货数',
    key: 'reduceQuantity',
    align: 'right',
    minWidth: 100
  }, {
    title: '异常数',
    key: 'abnormalQuantity',
    align: 'right',
    minWidth: 100
  }, {
    title: '待审基金',
    key: 'waitAuditFund',
    align: 'right',
    minWidth: 100
  }, {
    title: '审定基金',
    key: 'auditFundAmount',
    align: 'right',
    minWidth: 100
  }, {
    title: '操作',
    align: 'right',
    minWidth: 150,
    fixed: 'right',
    render: (h, params) => {
      if (params.row.isCanAudit) {
        return (
          <div>
            {renderButton(h, {text: '审核', type: 'primary'}, () => {bus.$emit("checkRow", {row: params.row})})}
            {renderButton(h, {text: '明细'}, () => {bus.$emit("detailRow", {row: params.row})})}
          </div>
        )
      } else {
        return (
          <div>
            {renderButton(h, {text: '查看', type: 'primary'}, () => {bus.$emit("lookRow", {row: params.row})})}
            {renderButton(h, {text: '明细'}, () => {bus.$emit("detailRow", {row: params.row})})}
          </div>
        )
      }
    }
  }],
  data: []
}
export default data
